package com.example;

import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`,
// then press Enter. You can now see whitespace characters in your code.
public class Main {
    public static void main(String[] args) {
        HashMap<String,String> hashMap = new HashMap<>();
        hashMap.put("string","0");
        hashMap.put("shelf","2");

        System.out.println(hashMap);
        hashMap.remove("string");

        //hashMap.put("string","3");
        System.out.println(hashMap.get("string"));
        System.out.println(StringUtils.isEmpty(hashMap.get("string")));
        hashMap.remove("string");

        String photoCout = StringUtils.isEmpty(hashMap.get("string")) ? "0" : hashMap.get("string");
        System.out.println(photoCout);


        List<String> list = new ArrayList<>();
        Collections.addAll(list, "apple-1", "banana-2", "cherry-3");
        list.stream()
                .map(s -> Integer.parseInt(s.split("-")[1]))
                .forEach(System.out::println);
    }
}